<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <button class="btn1">绑定事件</button>
  <button class="btn2">移除事件</button>
  <script>
  //removeEventListener

    const btn1 = document.querySelector('.btn1')
    const btn2 = document.querySelector('.btn2')
    btn1.addEventListener('click',fn)
    function fn(){
      console.log('我点了一次')
      
    }
    btn2.addEventListener('click',()=>{
      btn1.removeEventListener('click',fn)
    })
  </script>
</body>
</html>